package com.mceil.mceilbase.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.mceil.mceilbase.R;
import com.mceil.mceilbase.bean.AddRecordsBean;

import java.util.List;

public class AddRecordsAdpter extends BaseQuickAdapter<AddRecordsBean, BaseViewHolder> {

    public AddRecordsAdpter(int layoutResId, @Nullable List<AddRecordsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, AddRecordsBean addRecordsBean) {
        baseViewHolder.setText(R.id.tv_name, addRecordsBean.getName());
        if (addRecordsBean.getSex() == 1) {
            baseViewHolder.setImageResource(R.id.iv_head, R.drawable.icon_boy);
        } else {
            baseViewHolder.setImageResource(R.id.iv_head, R.drawable.icon_girl);
        }

    }
}
